#include<unistd.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<sys/wait.h>

int main(){
    char buff[1024];
    int pfd[2];
    int res = pipe(pfd);
    if(res == -1){
        perror("pipe");
        exit(1);
    }
    int count = 0;
    while(1){
        write(pfd[1], buff, sizeof(buff));
        ++count;
        printf("write %dk bytes to pipe\n", count);
    }
    return 0;
}